package com.teaphy.coroutinecrawler.flow.operators.transform

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.transform
import kotlinx.coroutines.flow.withIndex

fun main() = runBlocking {
    flowOf(1, 2, 3)
        .withIndex()
        .collect {
            println("receive value: ${it.value}, index: ${it.index}")
        }

    println("Done")
}